create database QLK;
use QLK;
create table login(
	Usename varchar(15) constraint FK_login primary key,
	Password varchar(15),
	[Status] varchar(10)
)
go
create table NCC(
	MaNCC varchar(10) constraint PK_NCC primary key,
	TenNCC nvarchar(25),
	DiaChi nvarchar(50),
	Masothue varchar(10),
	SoTK varchar(10)	
)
go
create table HangHoa(
	MaHang varchar(10) constraint PK_hanghoa primary key,
	TenHang varchar(25),
	ChungLoai varchar(25),
	DonGia float,
	DVtinh varchar(5),
	HSD datetime,
	Soluong int	
)
go
drop table HangHoa
go
insert into login values('lanh','111189','admin');
insert into login values('huy','ham','quanly');
insert into login values('tam','ham','nhanvien');
insert into login values('lan','123','admin');
go
insert into NCC values('110i','Duc Tuan', 'Nam Dinh', '123MSK', '0056');
insert into NCC values('120i','Duc Long', 'Nam Dinh', '124MSK', '0057');
insert into NCC values('130i','Hoa Tuan', 'Nam Dinh', '125MSK', '0058');
insert into NCC values('140i','Lam Tran', 'Nam Dinh', '126MSK', '0059');
go
select * from NCC
select * from login
go
insert into HangHoa values('MN1','Rau xanh','loai1','3500','kg','9/1/2012','100');
insert into HangHoa values('MN2','Sup lo','loai2','kg','9/1/2012','100');
insert into HangHoa values('MN3','du du','loai1','kg','9/1/2012','100');
insert into HangHoa values('MN4','cam tuoi','loai3','kg','9/1/2012','100');
insert into HangHoa values('MN5','xoai xanh','loai1','kg','9/1/2012','100');

